'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller, middleware } = app;
  const { tryError, login } = middleware;
  const { admin } = controller;


  router.get('/ops/api/active/info', tryError, login, admin.active_info);
  router.post('/ops/api/active/edit', tryError, login, admin.active_info_edit);

  router.post('/ops/api/cities/upload', tryError, login, admin.cities_upload);
  router.get('/ops/api/cities/info', tryError, login, admin.cities_info);
  router.get('/ops/api/cities/info/select', tryError, login, admin.cities_info_select);
  router.get('/ops/api/cities/scene/select', tryError, login, admin.cities_scene_select);
  router.post('/ops/api/cities/edit', tryError, login, admin.cities_edit);
  router.delete('/ops/api/cities/delete', tryError, login, admin.cities_delete);

  router.get('/ops/api/cities/disabled', tryError, login, admin.cities_disabled);
  router.delete('/ops/api/cities/disabled', tryError, login, admin.cities_disabled_delete);
  router.post('/ops/api/cities/disabled', tryError, login, admin.cities_disabled_add);

  router.get('/ops/api/reserve/info/export', tryError, login, admin.reserve_info_export);
  router.get('/ops/api/reserve/info', tryError, login, admin.reserve_info);
  router.get('/ops/api/constant/selects', tryError, login, admin.constant_selects);
  router.post('/ops/api/test', tryError, login, admin.test);
};


